package collectionTaks;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**  练习Set集去重操作 */
public class SetDemo02 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("one");
        list.add("two");
        list.add("three");
        list.add("four");
        list.add("five");
        list.add("one");
        System.out.println(list);//[one, two, three, four, five, one]

        Set<String > set = new HashSet<>();
        set.addAll(list);
        System.out.println(set);//[four, one, two, three, five]

















    }
}
